<!DOCTYPE>
<html>
<head>
  <title>Q.Dialog | QLib | Powered By PHPKIND</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <!-- 使用QLib控件是必须包含样式表 -->
  <link type="text/css" rel="stylesheet" href="../ui.css" />
  <!--  
  提示：src="{QLib目录}/Q.js" 
  根据实际存放路径， 测试代码都是在QLib目录的samples文件夹下，所以这里用的是"../Q.js" 
  -->
  <script type="text/javascript" src="../Q.js">
  <!--
  // 需要加载额外库时
  import utils.stl;
  import utils.xml;
  import ui.drag;
  import ui.contextmenu;
  import ui.wndx-1-0-2;
  -->
  </script>

  <script>
  <!--
  /* 
  // 基于prototype的继承实现
  // 警告：调用父类的（被重载的）同名函数调用需要借助this.__super__.method.call(this, arguments);
  var CLASS = function() {};
  CLASS.prototype.extend = function(props) {
    var parent_class = this.prototype;  
    var this_class = function() {
      this.__super__.__init__.apply(this, arguments); 
      this.__init__.apply(this, arguments);
    };
   
    // sub class -> parent class 
    this_class.prototype = Object.create(parent_class);
    
    // copy properties
    for(var name in props) {
      this_class.prototype[name] = props[name];  
    }

    this_class.prototype.constructor = this_class;
    this_class.extend = parent_class.extend;
    this_class.prototype.__super__ = parent_class;  
    return this_class;
  }

  CLASS.extend = function(props) {
    return this.prototype.extend.call(this, props);
  }

  var a = CLASS.extend({
    a_int: 10,
    __init__: function() {
      console.log('a __init__');
    }    
  }); 

  var b = a.extend({
    b_int: 20,
    __init__: function() {
      //this.__super__.__init__.apply(this);
      console.log('b __init__');
    }    
  });

  var c = b.extend({
    c_int: 30,
    __init__: function() {
      console.log('c __init__');
    }    
  });

  var ai = new c;
  */
  
  var g_test_messagebox;
  var g_test_dialog;
  var g_multi_window;
  Q.Ready(function() {
    // 提示对话框
    Q.$('btnOpenMessageBox').onclick = function() {
      g_test_messagebox = new Q.MessageBox({
        title: "提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口提示窗口",
        content: Q.$('test-domodal'),
        on_close : function() { Q.printf('user close the dialog'); },
      });
    }

    Q.$('btnOpenDialog').onclick = function() {
      g_test_dialog = new Q.Dialog({
        title: 'Normal Dialog', 
        width:480, 
        height:370,
        buttons: [
          { 
            text:'确 定', 
            onclick: function() { alert(1); return true; } 
          }, 
          { 
            text:'取 消', 
            onclick: function() { alert(2); return true; } 
          }, 
        ],
        });
      g_test_dialog.show(true);
      g_test_dialog.set_content("test flash");
      g_test_dialog.adjust();
      g_test_dialog.center();
    }
  
    Q.$('test-domodal').onclick = function() {
      new Q.MessageBox({
        parent: g_test_dialog,
        title: "test",
        content: 'test-domodal',
      });
    }
  });
  
  -->
  </script>
</head>
<body onselectstart="return false;" style=" background: #CCC;height: 100%;overflow:hidden;-moz-user-select:none;-webkit-user-select: none;">

<p>提示对话框</p>
<button id="btnOpenDialog">Dialog</button>
<button id="btnOpenMessageBox">MessageBox</button>
<!-- wndx template -->
<embed id="flash" style="display:none;" pluginspage='http://www.macromedia.com/go/getflashplayer' src='http://you.video.sina.com.cn/api/sinawebApi/outplayrefer.php/vid=3685396_1292548084_ah21RiZsBjPK+l1lHz2stqkP7KQNt6nki2O2vlasJQZdQ0/XM5GaZNUC4yDQFokbpWFOQpA6dvcg/s.swf' type='application/x-shockwave-flash' name='sinaplayer' allowFullScreen='true' allowScriptAccess='always' width='480' height='370' wmode='transparent'></embed>

<button id="test-domodal" style="display:none;">DoModal</button>
<!-- wndx template -->
<br>

<div id='debug_window' style='width:100%;height: 300px;overflow: auto;'>

</div>

<div style="background: red; height: 40px; line-height: 40px; ">
  <button style="margin: 12px 0 0 0; padding:0; background:none; height: 16px;border-width:0;background:blue;">test</button>
</div>




</body>
</html>
